package com.learn3;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {

        AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(ScopeConfig.class);

        SingletonService s1 = ac.getBean(SingletonService.class);
        SingletonService s2 = ac.getBean(SingletonService.class);
        System.out.println("SingletonService是否相等：" + (s1 == s2));

        PrototypeService p1 = ac.getBean(PrototypeService.class);
        PrototypeService p2 = ac.getBean(PrototypeService.class);
        System.out.println("PrototypeService是否相等：" + (p1 == p2));
    }
}
